﻿using System.Configuration;

namespace ParseTask.util
{
    public class AppConfig
    {


        /// <summary>
        /// 获取
        /// </summary>
        /// <returns></returns>
        public static string GetConnectionStringByName(string keyName = "SQLiteDB")
        {
            if (ConfigurationManager.ConnectionStrings != null && ConfigurationManager.ConnectionStrings[keyName] != null)
            {
                return ConfigurationManager.ConnectionStrings["SQLiteDB"].ConnectionString;
            }
            return null;
        }



        /// <summary>
        /// 获取
        /// </summary>
        /// <returns></returns>
        public static string GetAppSettingsValueByName(string keyName = "")
        {
            if (ConfigurationManager.AppSettings != null)
            {
                return ConfigurationManager.AppSettings[keyName];
            }
            return null;
        }
    }
}
